home *** CD-ROM | disk | FTP | other *** search
/ Programming Sound Cards / Programming Sound Cards.iso / sound_00 / powdemo8.bas < prev    next >
BASIC Source File  |  1995-01-01  |  1KB  |  64 lines

  1. $link "pow.pbl"
  2. $include "pow.inc"
  3.  
  4. 'POW! Demo #8 - .POW library sample playback
  5. 'Once again, compile to a standalone .EXE and run
  6. 'from DOS, as we're using background DMA routines.
  7. 'You'll require the TEST.POW file that came with
  8. 'POW! for this one.
  9.  
  10. q%=pbvhost
  11. shift right q%,5
  12. if q% and 1 then
  13.     print:print "Please run from a standalone .EXE only."
  14.      end
  15. end if
  16.  
  17. if sbdetect=0 then
  18.     print "Soundblaster required!":end
  19. end if
  20.  
  21.  
  22. e$=environ$("BLASTER")
  23.  
  24. if e$<>"" then
  25.     bp%=instr(e$,"A")  'Base port
  26.     if bp%<>0 then
  27.          bp$="&h"+mid$(e$,bp%+1,3)
  28.           sbsetbase val(bp$)
  29.      end if
  30.      i%=instr(e$,"I")   'Interrupt number
  31.      if i%<>0 then
  32.          i$=mid$(e$,i%+1,1)
  33.           sbsetint val(i$)
  34.      end if
  35.      d%=instr(e$,"D")   'DMA number
  36.      if d%<>0 then
  37.          d$=mid$(e$,d%+1,1)
  38.           sbsetdma val(d$)
  39.      end if
  40. end if
  41.  
  42.  
  43. sv$="test.pow"
  44. if dir$(sv$)="" then
  45.     line input "Path to TEST.POW: ";pth$
  46.      if right$(pth$,1)<>"\" then pth$=pth$+"\"
  47.      sv$=pth$+sv$
  48.      if dir$(sv$)="" then end
  49. end if
  50.  
  51. cls
  52. print:print ".POW File Sample Playback":print
  53. print "Press keys 1-8 to play back the corresponding"
  54. print ".POW sample, or ESC to end."
  55. sbreset 'Reset the SB's DAC
  56. keyloop:
  57.     a$=inkey$:if a$="" then goto keyloop
  58.      if a$=chr$(27) then sbreset:end
  59.      if a$>="1" and a$<="8" then
  60.          sm%=val(a$)
  61.           sbplaypow sv$,sm%  'Pretty easy eh?
  62.      end if
  63.      goto keyloop
  64.